#pragma once
#include <ntifs.h>

#ifdef DBG
    #define DBGPRINT(_fmt, ...) DbgPrint(_fmt, __VA_ARGS__)
    #define ERRPRINT(s, c) \
        const char* str##s = #s;\
        DbgPrint("%s: %s Error, Code: %X\r\n", __FUNCTION__, str##s, c)
    #define INT3    KdBreakPoint()
#else
    #define DBGPRINT(_fmt, ...) { NOTHING; }
    #define ERRPRINT(s, c)
    #define INT3
#endif

#define USTRING_DEVICE_NAME     L"\\Device\\IrpCommunication"
#define USTRING_WIN32_NAME      L"\\DosDevices\\IrpCommunication"

#define TAG_PROCESS_NAME        'mNsP'

typedef struct _KLDR_DATA_TABLE_ENTRY
{
    CHAR Reserve[0x68];
    UINT32 Flags;
} KLDR_DATA_TABLE_ENTRY, * PKLDR_DATA_TABLE_ENTRY;

typedef struct _PROCESS_NAME
{
    LIST_ENTRY Entry;
    CHAR strProcessName[50];
}PROCESS_NAME, * PPROCESS_NAME;

typedef NTSTATUS (*FnZwQueryInformationProcess)(
  _In_      HANDLE           ProcessHandle,
  _In_      PROCESSINFOCLASS ProcessInformationClass,
  _Out_     PVOID            ProcessInformation,
  _In_      ULONG            ProcessInformationLength,
  _Out_opt_ PULONG           ReturnLength
);


extern FnZwQueryInformationProcess _ZwQueryInformationProcess;
extern LIST_ENTRY g_ProcessNameListHead;
extern KSPIN_LOCK g_ListSpinLock;
extern PDEVICE_OBJECT g_pDeviceObject;
extern PKEVENT g_pkEvent;
